package com.addressbook.tests;

import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Random;

import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;

import com.addressbook.fw.ApplicationManager;

public class TestBase {

	protected ApplicationManager app = new ApplicationManager();
    
    @BeforeTest
    public void setUp() throws Exception {
            String configFile = System.getProperty("configFile", "application.properties");
            Properties properties = new Properties();
            properties.load(new FileReader(new File(configFile)));
            app = ApplicationManager.getInstance(properties);           
    }

    @AfterTest
    public void tearDown() throws Exception {
            app.stop();
            
    }
}